<?php
namespace Home\Controller;
use Think\Controller;
class BaseController extends \Think\Controller {
    protected $userinfo;
    protected $signatures;
    public function _initialize() {
        if (!session('user')) {
           $this->redirect('Public/login'); 
        }
        $this->userinfo = session('user');
        if (!S('signature_'.$this->userinfo['id'])) {
           $signatures = D('Signature')->getNatures(array('uid'=>$this->userinfo['id']));
           S('signature_'.$this->userinfo['id'], $signatures);
       }
        $this->signatures = S('signature_'.$this->userinfo['id']);
    }
}